package controleur;

import ihm.ihmFenetre;

import java.awt.Cursor;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.swing.JLabel;
import javax.swing.JOptionPane;

import Traduction.RessourceLang;

public class mouseLabel implements MouseListener {

	ihmFenetre fenetre;
	JLabel label;
	
	public mouseLabel(ihmFenetre pfenetre, JLabel pLabel) {
		label = pLabel;
		fenetre = pfenetre;
	}

	@Override
	public void mouseClicked(MouseEvent arg0) {
		if(((JLabel) arg0.getComponent()).getName().equals("compte"))
		{
			fenetre.getCard().show(fenetre.getContentPane(), "creationCompte");
		}
		else if(((JLabel) arg0.getComponent()).getName().equals("password"))
		{
			JOptionPane.showMessageDialog(null, RessourceLang.getLabel("Oubli.password"), "Pass",
					JOptionPane.CANCEL_OPTION);
		}
			
	}

	@Override
	public void mouseEntered(MouseEvent arg0) {
		label.setCursor(new Cursor(Cursor.HAND_CURSOR));
	}

	@Override
	public void mouseExited(MouseEvent arg0) {
		label.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
	}

	@Override
	public void mousePressed(MouseEvent arg0) {
	}

	@Override
	public void mouseReleased(MouseEvent arg0) {
	}

}
